/**
 * Created with Vim7.3 ubuntu12.04
 * @fileOverview :  Index
 * @author : Lyle <lylechen2014@gmial.com>
 * @since : 2014-08-18 11:00:47
 * @filename : static/nmm/src/views/index.js
 * @version : 
 * @description : 
 */
define(function(require, exports, module){
    //require('{component}addIconsToScreen/addIconsToScreen.css');
    var IndexView,mId = 'index',reRender = false,
        //addIconsToScreen  = require('{component}addIconsToScreen/addIconsToScreen');
        tpl = require('{view}index.tpl');
 
    IndexView = Backbone.View.extend({

        el: 'body',

        template: _.template(tpl),

        initialize: function () {
             //$.addIconToScreen();
        },

        bindEvt : function() {
            var tthis = this;
            $('#'+mId).find('.joinus').on('tap',function(){
                tthis.joinusBind();
            });

            $('#'+mId).find('.signin').on('tap',function(){
                tthis.signinBind();
            });

            $('#'+mId).find('.index_full').on('tap',function(){
                 window.location.href = mainSite;
            });
        },      

        render: function (obj) {
            share.checkPermission(false);
            share.reRender(reRender,mId);
            if ($('#'+mId).length < 1) { 
                $('body').append(this.template(lang)); 
                this.bindEvt(); 
            } else {
                $('#'+mId).css('display','block');
            }
            share.setProfileOptions();
        },

        joinusBind : function() {
            setTimeout(function() {
               window.location.href = '#joinus/whole';
            },300); 
        },

        signinBind : function() {
             window.location.href = '#signin/whole'; 
        }
	});

	module.exports = IndexView;
})

